﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using V = Science.Mathematics.VectorCalculus;

namespace VectorCalculus5Ed.Chapter7.Section7
{
    public class Example02
    {
        public Example02()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
        public void Compute()
        {
            V.Function.ToLastType<double[], double[]> ff
                = new V.Function.ToLastType<double[], double[]>(func);
            V.Surface s = new V.Surface(ff);

            double[] at = { 3.0, 2.0 };

            result += s.CurvatureGauss(at).ToString() + "\r\n";
            result += s.CurvatureMean(at).ToString() + "\r\n";
            result += (1.0/5.0/5.0).ToString() + "\r\n";
            result += (1.0/5.0).ToString() + "\r\n";
        }
        private double[] func(double[] u)
        {
            double[] x = new double[3];
            x[0] = u[0];
            x[1] = u[1];
            x[2] = - Math.Sqrt(5.0*5.0 - u[0]*u[0] - u[1]*u[1]);
            return x;
        }
    }
}
/*
0.0399999993747009
0.199999998436752
0.04
0.2
*/